package com.huayue.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import com.huayue.annotation.LogAnno;
import com.huayue.entity.ProductType;
import com.huayue.service.ProductTypeService;
import com.huayue.util.PageHelper;

/**
 * 商品类型
 */
@Controller
@RequestMapping("/productType")
public class ProductTypeController {
    @Autowired
    ProductTypeService svc;

    BaseController bc = new BaseController();

    @LogAnno(operateType = "添加-商品类型")
    @RequestMapping("/add")
    public ModelAndView add(ProductType productType) {
        return bc.add(svc, productType);
    }

    @LogAnno(operateType = "修改-商品类型")
    @RequestMapping("/update")
    public ModelAndView update(ProductType productType) {
        return bc.update(svc, productType);
    }

    @LogAnno(operateType = "删除-商品类型")
    @RequestMapping("/delete")
    public ModelAndView delete(ProductType productType) {
        return bc.delete(svc, productType);
    }

    @RequestMapping("/findOne")
    public ModelAndView findOne(ProductType productType) {
        return bc.findOne(svc, productType);
    }

    @RequestMapping("/findPage")
    public ModelAndView findPage(PageHelper page, ProductType productType) {
        return bc.findPage(svc, page, productType, productType);
    }
}
